package com.link2room.jetfire.enums;

import org.apache.commons.lang.StringUtils;

/*
 * 订单状态 R预订，X取消，I入住，O结账，S挂账
 */
public enum ReservationResStaEnum {

	R("R", "预订"),X("X", "取消"),I("I", "入住"),O("O", "结账"),S("S", "挂账"),;
	
	private String code;
	private String des;

	private ReservationResStaEnum(String code, String des) {
		this.code = code;
		this.des = des;
	}
	
	public static String getDesByCode(String code) {
		if(StringUtils.isBlank(code) ) {
			return null;
		}
		for(ReservationResStaEnum reservationResStaEnum : ReservationResStaEnum.values()) {
			if(StringUtils.equals(code, reservationResStaEnum.getCode())) {
				return reservationResStaEnum.getDes();
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDes() {
		return des;
	}

	public void setDes(String des) {
		this.des = des;
	}

}
